Skip to content

Add 'sandbox-pod' command. Implement test. #1052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Oct 19, 2015
Merged

Conversation

e2l3n
Copy link
Contributor

@e2l3n e2l3n commented Oct 13, 2015

Add sandbox-pod command execution to restirct write permissions outside project directory.
TeamPulse - [Server] Sandbox Cocoa Pods
Related: #1065

@e2l3n e2l3n force-pushed the tpopov/sandbox-pods branch 2 times, most recently from a57e2e9 to e721403 Compare October 13, 2015 08:32
@e2l3n e2l3n force-pushed the tpopov/sandbox-pods branch from e721403 to b6b80de Compare October 13, 2015 09:41
@e2l3n
Copy link
Contributor Author

e2l3n commented Oct 13, 2015

Is it possible that CocoaPods is not installed on our build machine?

let fs: IFileSystem = testInjector.resolve("fs");
let config = testInjector.resolve("config");
let childProcess = testInjector.resolve("childProcess");
let projectIntegrationTest = new ProjectIntegrationTest();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tab <-> spaces issue? there's extra white space

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed incorrect spacing.

@e2l3n
Copy link
Contributor Author

e2l3n commented Oct 14, 2015

Regarding the CI error message

Error: spawn ENOENT
    at Object.Future.wait (/home/travis/build/NativeScript/nativescript-cli/node_modules/fibers/future.js:535:15)
    at Context.<anonymous> (/home/travis/build/NativeScript/nativescript-cli/test/project-service.js:142:118)
    at /home/travis/build/NativeScript/nativescript-cli/node_modules/mocha-fibers/lib/mocha-fibers.js:25:14
    - - - - -
    at errnoException (child_process.js:1011:11)
    at Process.ChildProcess._handle.onexit (child_process.js:802:34)

Line 142 corresponds to

childProcess.spawnFromEvent(podTool, ["install"], "close", { cwd: workingFolderPath, stdio: 'inherit' }).wait();

I strongly believe the build machine doesn't have CocoaPods installed.

@e2l3n e2l3n force-pushed the tpopov/sandbox-pods branch from ebc0349 to 5bcca4c Compare October 14, 2015 15:59
@@ -39,21 +39,20 @@ class ProjectIntegrationTest {
return projectService.createProject(projectName);
}

public getDefaultTemplatePath(): IFuture<string> {
public getDefaultTemplatePath(templateName: string): IFuture<string> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function should be renamed for example getNpmPackagePath(packageName: string)

@Fatme
Copy link
Contributor

Fatme commented Oct 15, 2015

👍 after taking care of my comments.

let workingFolderPath = temp.mkdirSync("ios_project");

let iosTemplatePath = path.join(projectIntegrationTest.getDefaultTemplatePath("tns-ios").wait(), "framework/");
childProcess.exec(`cp -R ${iosTemplatePath} ${workingFolderPath}`, { cwd: workingFolderPath }).wait();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should use either $fs or shelljs

@e2l3n e2l3n force-pushed the tpopov/sandbox-pods branch 7 times, most recently from 34ae123 to 561cf92 Compare October 15, 2015 16:39
@e2l3n e2l3n force-pushed the tpopov/sandbox-pods branch from 561cf92 to 39a3bec Compare October 16, 2015 07:07
@e2l3n e2l3n force-pushed the tpopov/sandbox-pods branch 2 times, most recently from f4cb9c7 to cef3792 Compare October 16, 2015 08:07
@e2l3n e2l3n force-pushed the tpopov/sandbox-pods branch 14 times, most recently from 62b3593 to 6cd9dcf Compare October 18, 2015 14:28
@ns-bot
Copy link

ns-bot commented Oct 18, 2015

Test PASSed.

@e2l3n e2l3n force-pushed the tpopov/sandbox-pods branch from 6cd9dcf to 41fdcc8 Compare October 18, 2015 14:37
@ns-bot
Copy link

ns-bot commented Oct 18, 2015

Test PASSed.

@e2l3n e2l3n force-pushed the tpopov/sandbox-pods branch from 41fdcc8 to a2dfd7d Compare October 18, 2015 15:56
@ns-bot
Copy link

ns-bot commented Oct 18, 2015

Test PASSed.

@e2l3n e2l3n force-pushed the tpopov/sandbox-pods branch from d731855 to aced05d Compare October 19, 2015 07:14
@e2l3n e2l3n force-pushed the tpopov/sandbox-pods branch from aced05d to 20f4b26 Compare October 19, 2015 07:35
@ns-bot
Copy link

ns-bot commented Oct 19, 2015

Test PASSed.

@e2l3n
Copy link
Contributor Author

e2l3n commented Oct 19, 2015

Changes have been applied. Please review again. The timeout has been increased to 15 seconds but sporadically the test fails with a timeout error. This should happen very rarely though but we should have into account. ping @NativeScript/appbuilder

@rosen-vladimirov
Copy link
Contributor

👍

e2l3n added a commit that referenced this pull request Oct 19, 2015
Add 'sandbox-pod' command. Implement test.
@e2l3n e2l3n merged commit 5ebebb4 into release Oct 19, 2015
@teobugslayer teobugslayer deleted the tpopov/sandbox-pods branch November 18, 2015 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants